import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';

/**
 * Generated class for the OrderConfirmationPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-order-confirmation',
  templateUrl: 'order-confirmation.html',
})
export class OrderConfirmationPage {
    money: number;
    days: any;
    day: any;
  countService_price: any;
  service_price: any;
  num: any;
  unitPrice: any;
  choice: boolean;
  constructor(public navCtrl: NavController, public navParams: NavParams) {
  }
  
  ionViewDidLoad() {
    this.countService_price = this.service_price = this.navParams.get('service_price');
    this.day =  this.navParams.get('day');
    this.num = this.navParams.get('num');
    this.choice = this.navParams.get('choice');
    this.unitPrice = this.service_price / this.num;
    console.log(this.unitPrice);
    console.log(this.service_price);
    console.log(this.num);
    console.log(this.day);
    if(this.day==1){
      this.days=this.money=1;
    }else if(this.day==7){
      this.days=this.money=7;
    }else if(this.day==15){
      this.days=this.money=15;
    }else if(this.day==30){
      this.days=this.money=30;
    }
  }
}
